/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package at.alexanderpehm.pony.event;

import java.util.ArrayList;
import java.util.List;

/**
 * Central Registry for all Pony events.
 * @author Alexander Pehm
 */
public class EventRegistry {

    private final static EventRegistry instance = new EventRegistry();
    private List<PonyEventListener> listeners = new ArrayList<PonyEventListener>();

    private EventRegistry() {
    }

    public void registerListener(PonyEventListener listener) {
        listeners.add(listener);
    }

    public void notifyListeners(EventType type, Object event){
        for(PonyEventListener listener : listeners){
            listener.notify(type, event);
        }
    }

    public static EventRegistry getInstance() {
        return instance;
    }

    public enum EventType {

        NOTE_SELECTED
    }
}
